<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNationSendGiftLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('nation_send_gift_log', function (Blueprint $table) {
            $table->increments('id');//自增id
            $table->integer('user_id')->comment('用户id');
            $table->unsignedInteger('veil_num')->default(0)->comment('婚纱数量');
            $table->unsignedInteger('kiss_num')->default(0)->comment('kiss数量');
            $table->unsignedInteger('is_ring')->default(0)->comment('是否领取戒指  1 领取 ');
            $table->unsignedInteger('status')->default(0)->comment('是否可以领取戒指  0否 1是');
            $table->timestamp('created_at')->default(\Illuminate\Support\Facades\DB::raw("CURRENT_TIMESTAMP"))->comment('创建时间');
            $table->unique(['user_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('nation_send_gift_log');
    }
}
